<%@ page contentType="text/html;charset=UTF-8"%>
<%@ page import="java.util.Vector,com.ejoysoft.wlanyz.business.Carriers,com.ejoysoft.wlanyz.business.*,com.ejoysoft.wlanyz.business.Bar,com.ejoysoft.common.Constants,com.ejoysoft.common.exception.NoRightException" %>
<%@page import="sun.reflect.generics.tree.IntSignature"%>
<%@page import="com.ejoysoft.common.Format"%>
<%@ page import="java.util.List"%>
<%@page import="java.util.Random"%>
<%@page import="java.util.List"%>
<%@page import="java.util.ArrayList"%>
<%@ include file="../include/jsp/head.jsp"%>

<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'regional_coverage.jsp' starting page</title>
    <script type="text/javascript" src="http://api.map.baidu.com/api?v=1.4"></script>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<link href="../css/main.css" rel="stylesheet" type="text/css" />
	<script language="JavaScript" src="../include/date/popc.js"></script>
	<script src="../include/js/list.js"></script>
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
  </head>
  
  <body>
  <%
 	String indexs = ParamUtil.getString(request,"indexs");
  	String str[] = indexs.split(",");
  	//System.out.println("kkkkkkkkkkkkk"+str[0]+"jjjjjjjjjjjj"+str[1]);
  	
  	int n=str.length;
  	Carriers task0 = null;
	Carriers obj = new Carriers(globa);
	Bar b = new Bar("50", "#9933CC");
	b.setVar("bar_3d");
	//b.setVar("bar_glass");
	//b.setVar("bar_fade");
	Bar b2 = new Bar("50", "#0000FF");
	b2.setVar("bar_3d");
	Bar b3 = new Bar("50", "#C79810");
	b3.setVar("bar_3d");
	b.key("中国移动", 15);
	b2.key("中国联通", 15);
	b3.key("中国电信",15);

	
		String where = "where strCarriers= '中国移动'";
		Vector<Carriers> vctObj = obj.returnindex(where);
		double []sun=new double [n];
		int intVct=(vctObj!=null&&vctObj.size()>0?vctObj.size():0);
		if(vctObj!=null){
    	for (int j = 0;j < vctObj.size(); j++) {
	    	Carriers obj1 = vctObj.get(j);
	    	for (int i=0;i<=n-1;i++)
	    	{
  		     if(str[i].contains("intAp_Relevacy_Sucrate"))
  		     {
  			  sun[i]+=obj1.getIntAp_Relevacy_Sucrate();
  			  }
		    if(str[i].contains("intAp_Relevacy_Delay"))
		    {
		     sun[i]+=obj1.getIntAp_Relevacy_Delay();
		    }
		    if(str[i].contains("intWeb_Auth_Sucrate"))
		    {
		     sun[i]+=obj1.getIntWeb_Auth_Sucrate();
		    }
		    if(str[i].contains("intWeb_Off_Sucrate"))
		    {
		     sun[i]+=obj1.getIntWeb_Off_Sucrate();
		    }
		    if(str[i].contains("intPeap_Auth_Sucrate"))
		    {
		     sun[i]+=obj1.getIntPeap_Auth_Sucrate();
		    }
		    if(str[i].contains("intPeap_Off_Sucrate"))
		    {
		     sun[i]+=obj1.getIntPeap_Off_Sucrate();
		    }
		    if(str[i].contains("intHttp_Req_Sucrate"))
		    {
		     sun[i]+=obj1.getIntHttp_Req_Sucrate();
		    }
		    if(str[i].contains("intPing_Sucrate"))
		    {
		     sun[i]+=obj1.getIntPing_Sucrate();
		    }
		    if(str[i].contains("intFtp_Up_Sucrate"))
		    {
		     sun[i]+=obj1.getIntFtp_Up_Sucrate();
		    }
		    
		   if(str[i].contains("intFtp_Down_Sucrate"))
		   {
		     sun[i]+=obj1.getIntFtp_Down_Sucrate();
		    }
		   if(str[i].contains("intUser_Seg_Sucrate"))
		   {
		     sun[i]+=obj1.getIntUser_Seg_Sucrate();
		    }
		   if(str[i].contains("intUser_Roam_Sucrate"))
		   {
		     sun[i]+=obj1.getIntUser_Roam_Sucrate();
		    }
		   if(str[i].contains("intWeb_Up_Delay"))
		   {
		     sun[i]+=obj1.getIntWeb_Up_Delay();
		    }
		   if(str[i].contains("intWeb_Down_Delay"))
		    {
		     sun[i]+=obj1.getIntWeb_Down_Delay();
		    }
		   if(str[i].contains("intPeap_Up_Delay"))
		   {
		     sun[i]+=obj1.getIntPeap_Up_Delay();
		    }
		   if(str[i].contains("intHttp_Resp_Delay"))
		   {
		     sun[i]+=obj1.getIntHttp_Resp_Delay();
		    }
		   if(str[i].contains("intPing_Delay"))
		   {
		     sun[i]+=obj1.getIntPing_Delay();
		    }
		   if(str[i].contains("intFtp_Up_Speed"))
		   {
		     sun[i]+=obj1.getIntFtp_Up_Speed();
		    }
		   if(str[i].contains("intFtp_Down_Speed"))
		   {
		     sun[i]+=obj1.getIntFtp_Down_Speed();
		    }
	    }
	    }
	    }
	    for(int k=0;k<n;k++){
	    sun[k]=sun[k]/intVct;
	    b.add(Double.toString(sun[k]),"");
	    }
		
		
		String where2 = "where strCarriers= '中国联通'";
		Vector<Carriers> vctObj2 = obj.returnindex(where2);
		double []sun2=new double [n];
		int intVct2=(vctObj2!=null&&vctObj2.size()>0?vctObj2.size():0);
		if(vctObj2!=null){
    	for (int j = 0;j < vctObj2.size(); j++) {
	    	Carriers obj1 = vctObj2.get(j);
	    	for (int i=0;i<=n-1;i++)
	    	{
  		     if(str[i].contains("intAp_Relevacy_Sucrate"))
  		     {
  			  sun2[i]+=obj1.getIntAp_Relevacy_Sucrate();
  			  }
		    if(str[i].contains("intAp_Relevacy_Delay"))
		    {
		     sun2[i]+=obj1.getIntAp_Relevacy_Delay();
		    }
		    if(str[i].contains("intWeb_Auth_Sucrate"))
		    {
		     sun2[i]+=obj1.getIntWeb_Auth_Sucrate();
		    }
		    if(str[i].contains("intWeb_Off_Sucrate"))
		    {
		     sun2[i]+=obj1.getIntWeb_Off_Sucrate();
		    }
		    if(str[i].contains("intPeap_Auth_Sucrate"))
		    {
		     sun2[i]+=obj1.getIntPeap_Auth_Sucrate();
		    }
		    if(str[i].contains("intPeap_Off_Sucrate"))
		    {
		     sun2[i]+=obj1.getIntPeap_Off_Sucrate();
		    }
		    if(str[i].contains("intHttp_Req_Sucrate"))
		    {
		     sun2[i]+=obj1.getIntHttp_Req_Sucrate();
		    }
		    if(str[i].contains("intPing_Sucrate"))
		    {
		     sun2[i]+=obj1.getIntPing_Sucrate();
		    }
		    if(str[i].contains("intFtp_Up_Sucrate"))
		    {
		     sun2[i]+=obj1.getIntFtp_Up_Sucrate();
		    }
		    
		   if(str[i].contains("intFtp_Down_Sucrate"))
		   {
		     sun2[i]+=obj1.getIntFtp_Down_Sucrate();
		    }
		   if(str[i].contains("intUser_Seg_Sucrate"))
		   {
		     sun2[i]+=obj1.getIntUser_Seg_Sucrate();
		    }
		   if(str[i].contains("intUser_Roam_Sucrate"))
		   {
		     sun2[i]+=obj1.getIntUser_Roam_Sucrate();
		    }
		   if(str[i].contains("intWeb_Up_Delay"))
		   {
		     sun2[i]+=obj1.getIntWeb_Up_Delay();
		    }
		   if(str[i].contains("intWeb_Down_Delay"))
		    {
		     sun2[i]+=obj1.getIntWeb_Down_Delay();
		    }
		   if(str[i].contains("intPeap_Up_Delay"))
		   {
		     sun2[i]+=obj1.getIntPeap_Up_Delay();
		    }
		   if(str[i].contains("intHttp_Resp_Delay"))
		   {
		     sun2[i]+=obj1.getIntHttp_Resp_Delay();
		    }
		   if(str[i].contains("intPing_Delay"))
		   {
		     sun2[i]+=obj1.getIntPing_Delay();
		    }
		   if(str[i].contains("intFtp_Up_Speed"))
		   {
		     sun2[i]+=obj1.getIntFtp_Up_Speed();
		    }
		   if(str[i].contains("intFtp_Down_Speed"))
		   {
		     sun2[i]+=obj1.getIntFtp_Down_Speed();
		    }
	    }
    	
    	}}
    	for(int k=0;k<n;k++){
	    sun2[k]=sun2[k]/intVct2;
	    b2.add(Double.toString(sun2[k]),"");
	    }
		
		
		
		String where3 = "where strCarriers= '中国电信'";
		Vector<Carriers> vctObj3 = obj.returnindex(where3);
		double []sun3=new double [n];
		int intVct3=(vctObj3!=null&&vctObj3.size()>0?vctObj3.size():0);
		if(vctObj3!=null){
    	for (int j = 0;j < vctObj3.size(); j++) {
	    	Carriers obj1 = vctObj3.get(j);
	    	for (int i=0;i<=n-1;i++)
	    	{
  		     if(str[i].contains("intAp_Relevacy_Sucrate"))
  		     {
  			  sun3[i]+=obj1.getIntAp_Relevacy_Sucrate();
  			  }
		    if(str[i].contains("intAp_Relevacy_Delay"))
		    {
		     sun3[i]+=obj1.getIntAp_Relevacy_Delay();
		    }
		    if(str[i].contains("intWeb_Auth_Sucrate"))
		    {
		     sun3[i]+=obj1.getIntWeb_Auth_Sucrate();
		    }
		    if(str[i].contains("intWeb_Off_Sucrate"))
		    {
		     sun3[i]+=obj1.getIntWeb_Off_Sucrate();
		    }
		    if(str[i].contains("intPeap_Auth_Sucrate"))
		    {
		     sun3[i]+=obj1.getIntPeap_Auth_Sucrate();
		    }
		    if(str[i].contains("intPeap_Off_Sucrate"))
		    {
		     sun3[i]+=obj1.getIntPeap_Off_Sucrate();
		    }
		    if(str[i].contains("intHttp_Req_Sucrate"))
		    {
		     sun3[i]+=obj1.getIntHttp_Req_Sucrate();
		    }
		    if(str[i].contains("intPing_Sucrate"))
		    {
		     sun3[i]+=obj1.getIntPing_Sucrate();
		    }
		    if(str[i].contains("intFtp_Up_Sucrate"))
		    {
		     sun3[i]+=obj1.getIntFtp_Up_Sucrate();
		    }
		    
		   if(str[i].contains("intFtp_Down_Sucrate"))
		   {
		     sun3[i]+=obj1.getIntFtp_Down_Sucrate();
		    }
		   if(str[i].contains("intUser_Seg_Sucrate"))
		   {
		     sun3[i]+=obj1.getIntUser_Seg_Sucrate();
		    }
		   if(str[i].contains("intUser_Roam_Sucrate"))
		   {
		     sun3[i]+=obj1.getIntUser_Roam_Sucrate();
		    }
		   if(str[i].contains("intWeb_Up_Delay"))
		   {
		     sun3[i]+=obj1.getIntWeb_Up_Delay();
		    }
		   if(str[i].contains("intWeb_Down_Delay"))
		    {
		     sun3[i]+=obj1.getIntWeb_Down_Delay();
		    }
		   if(str[i].contains("intPeap_Up_Delay"))
		   {
		     sun3[i]+=obj1.getIntPeap_Up_Delay();
		    }
		   if(str[i].contains("intHttp_Resp_Delay"))
		   {
		     sun3[i]+=obj1.getIntHttp_Resp_Delay();
		    }
		   if(str[i].contains("intPing_Delay"))
		   {
		     sun3[i]+=obj1.getIntPing_Delay();
		    }
		   if(str[i].contains("intFtp_Up_Speed"))
		   {
		     sun3[i]+=obj1.getIntFtp_Up_Speed();
		    }
		   if(str[i].contains("intFtp_Down_Speed"))
		   {
		     sun3[i]+=obj1.getIntFtp_Down_Speed();
		    }
	    }
    	
    	}}
    	for(int k=0;k<n;k++){
	    sun3[k]=sun3[k]/intVct3;
	    b3.add(Double.toString(sun3[k]),"");
	    }
		
		
				
	
  
	Graph g = new Graph();
	//坐标标题
	g.title("多指标对比", "{font-size: 25px;}");
	g.getData_sets().add(b);
	g.getData_sets().add(b2);
	g.getData_sets().add(b3);
	g.bar_3D("75", "#D54C78", "2006", 8);
	g.bar_3D("75", "#3334AD", "2007", 8);
	g.bar_3D("75", "#C79810", "2007", 8);
	
	List<String> labels = new ArrayList<String>();
	if(vctObj3!=null){
    	
	    	Carriers obj1 = vctObj3.get(0);
	        for (int i=0;i<=n-1;i++)
	    	{
  		     if(str[i].contains("intAp_Relevacy_Sucrate"))
  		     {
  		      labels.add("AP关联成功率");
  		      }
		    if(str[i].contains("intAp_Relevacy_Delay"))
		    {
		     labels.add("AP关联时延");
		    }
		    if(str[i].contains("intWeb_Auth_Sucrate"))
		    {
		     labels.add("WEB认证成功率");
		    }
		    if(str[i].contains("intWeb_Off_Sucrate"))
		    {
		    labels.add("WEB下线成功率");
		    }
		    if(str[i].contains("intPeap_Auth_Sucrate"))
		    {
		     labels.add("PEAP认证成功率");
		    }
		    if(str[i].contains("intPeap_Off_Sucrate"))
		    {
		     labels.add("PEAP下线成功率");
		    }
		    if(str[i].contains("intHttp_Req_Sucrate"))
		    {
		     labels.add("HTTP请求成功率");
		    }
		    if(str[i].contains("intPing_Sucrate"))
		    {
		     labels.add("PING成功率");
		    }
		    if(str[i].contains("intFtp_Up_Sucrate"))
		    {
		    labels.add("FTP上行成功率");
		    }
		    
		   if(str[i].contains("intFtp_Down_Sucrate"))
		   {
		    labels.add("FTP下行成功率");
		    }
		   if(str[i].contains("intUser_Seg_Sucrate"))
		   {
		     labels.add("用户隔离成功率");
		    }
		   if(str[i].contains("intUser_Roam_Sucrate"))
		   {
		     labels.add("用户漫游成功率");
		    }
		   if(str[i].contains("intWeb_Up_Delay"))
		   {
		     labels.add("WEB认证时延");
		    }
		   if(str[i].contains("intWeb_Down_Delay"))
		    {
		    labels.add("WEB下线时延");
		    }
		   if(str[i].contains("intPeap_Up_Delay"))
		   {
		    labels.add("PEAP认证时延");
		    }
		   if(str[i].contains("intHttp_Resp_Delay"))
		   {
		     labels.add("HTTP响应时延");
		    }
		   if(str[i].contains("intPing_Delay"))
		   {
		    labels.add("PING平均时延");
		    }
		   if(str[i].contains("intFtp_Up_Speed"))
		   {
		    labels.add("FTP上行速率");
		    }
		   if(str[i].contains("intFtp_Down_Speed"))
		   {
		     labels.add("FTP下行速率");
		    }
	    }
	    }
	//labels.add(a);
	//labels.add("WEB认证成功率");
	//labels.add("WEB下线成功率");
	//labels.add("PEAP认证成功率");
	//labels.add("PEAP下线成功率");
	//labels.add("HTTP请求成功率");
	//labels.add("PING成功率");
	//labels.add("FTP上行成功率");
	//labels.add("FTP下行成功率");
	//labels.add("用户隔离成功率");
	//labels.add("用户漫游成功率");
	g.set_x_labels(labels);
	g.set_x_label_style("10", "#9933CC", 45, 1, "");
	g.set_x_axis_3d(5);
	g.x_axis_colour("#909090", "#ADB5C7");
	g.x_axis_colour("#909090", "#ADB5C7");
    g.x_axis_colour("#909090", "#ADB5C7");
	g.set_y_max(100);
	g.y_label_steps(10);
%>
<%=g.render()%>
  </body>
</html>
<%@ include file="../include/jsp/footer.jsp"%>
